import request from '../utils/request'
const api_name = '/order'

export default {
    // 获取课程购买状态
    isBought(courseId) {
        return request({
            url: `http://39.98.120.230:8080/api/order/isbought/${courseId}`,
            method: 'get'
        })
    },
    // 获取指定课程的订单信息
    showInfo(courseId) {
        return request({
            url: `http://39.98.120.230:8080/api/order/info/${courseId}`,
            method: 'get'
        })
    },
    // 根据课程编号创建课程订单
    createOrder(courseId) {
        return request({
            url: `http://39.98.120.230:8080/api/order/${courseId}`,
            method: 'post'
        })
    },
    //获取用户的所有订单
    getOrders(courseId) {
        return request({
            url: `http://39.98.120.230:8080/api/order/list`,
            method: 'get',

        })
    },
}
